feat: A2A streaming execution #2315
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR consolidates remote service functionality under the
a2anamespace and introduces streaming support for agent execution. The changes improve code organization, enable real-time response streaming, and remove deprecated remote service implementations.Changes
1. Remote Services Consolidation (
eb8dff96e6)autogen/remotemodule (856 lines removed)autogen/remote/agent.pyandautogen/remote/runtime.pytest/remote/autogen/remote/toautogen/a2a/remote/agent_service.py,errors.py,httpx_client_factory.py,protocol.py,retry.pya2a.remotenamespacepyproject.tomland.github/CODEOWNERSto reflect the new structure2. Streaming Service Support (
72132ca1be)AgentService.__call__()to return anAsyncGenerator[ServiceResponse, None]instead of a single responseAutogenAgentExecutor.execute()to handle streaming responses:ServiceResponsemodel supporting:messagefield)contextfield)input_requiredfield)utils.py:make_working_message()- for streaming status updatesmake_input_required_message()- for human-in-the-loop scenariosmake_artifact()- for final artifact creationtest/a2a/test_executor.py(175 new lines)test/a2a/test_parsing.py(removed 63 lines of redundant code)3. AgentService Streaming Execution Refinement (
f99fc6362d)AgentServicestreaming logic (9 insertions, 15 deletions)Benefits
autogen/a2a/remote/Testing
test/a2a/test_executor.pyMigration Notes
autogen.remoteshould migrate toautogen.a2a.remoteAgentServicenow returns an async generator - consumers should iterate over responsesAutogenAgentExecutorautomatically handles streaming, no changes needed for executor usersFiles Changed
autogen/a2a/remote/agent_service.py- Streaming implementationautogen/a2a/agent_executor.py- Streaming executor integrationautogen/a2a/remote/protocol.py- Enhanced protocol modelsautogen/a2a/utils.py- New utility functionstest/a2a/test_executor.py- Expanded test coverage